﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddGoal.aspx.cs" Inherits="PMP.Goals.AddGoal" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Add a New Goal</title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            text-align: right;
        }
        .style3
        {
            text-align: right;
            height: 24px;
        }
        .style4
        {
            height: 24px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        
        <table class="style1">
            <tr>
                <td class="style2">
                    Goal:</td>
                <td>
                    <asp:TextBox ID="txtGoal" runat="server" Height="20px" Width="500px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style3">
                    Task:</td>
                <td class="style4">
                    <asp:TextBox ID="txtTaskID" runat="server" Height="20px" Width="500px" AutoPostBack="true"
                        ontextchanged="txtTaskID_TextChanged"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style3">
                    Original Estimation:</td>
                <td class="style4">
                    <asp:TextBox ID="txtOrigEst" runat="server" Height="20px" Width="500px"></asp:TextBox>
                &nbsp;(hrs)(Need to fill if no specific task specified)</td>
            </tr>
            <tr>
                <td class="style2">
                    Owner:</td>
                <td>
                    <asp:DropDownList ID="ddlOwners" runat="server" Height="20px" Width="500px" 
                        DataSourceID="SqlDataSourceUsers" DataTextField="usr_name" DataValueField="id">
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="SqlDataSourceUsers" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:LocalConnectionString %>" 
                        ProviderName="<%$ ConnectionStrings:LocalConnectionString.ProviderName %>" SelectCommand="select top 1 '' as id, '' as usr_name, '000' as Team  from usr 
union
SELECT [id], [usr_name], team FROM [usr]
order by Team,usr_name"></asp:SqlDataSource>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    Progress:</td>
                <td>
                    <asp:DropDownList ID="ddlStatus" runat="server" Height="20px" Width="500px" 
                        DataSourceID="SqlDataSourceStatus" DataTextField="name" DataValueField="id">
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="SqlDataSourceStatus" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:LocalConnectionString %>" 
                        ProviderName="<%$ ConnectionStrings:LocalConnectionString.ProviderName %>" 
                        SelectCommand="SELECT [id], [name] FROM [goalstatus] ORDER BY [name]">
                    </asp:SqlDataSource>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    Sprint:</td>
                <td>
                    <asp:DropDownList ID="ddlSprints" runat="server" Height="20px" Width="500px" 
                        DataSourceID="SqlDataSourceSprints" DataTextField="sprint" DataValueField="id" >
                        <asp:ListItem Value="CURRENT">Current</asp:ListItem>
                        <asp:ListItem Value="NEXT">Next Sprint</asp:ListItem>
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="SqlDataSourceSprints" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:LocalConnectionString %>" 
                        ProviderName="<%$ ConnectionStrings:LocalConnectionString.ProviderName %>" 
                        SelectCommand="select id, sprint from sprint order by iscompleted, sprint">
                    </asp:SqlDataSource>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    Priority:</td>
                <td>
                    <asp:DropDownList ID="ddlPriority" runat="server" Height="20px" Width="500px" 
                        DataSourceID="SqlDataSourcePriority" DataTextField="name" DataValueField="id">
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="SqlDataSourcePriority" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:LocalConnectionString %>" 
                        ProviderName="<%$ ConnectionStrings:LocalConnectionString.ProviderName %>" 
                        SelectCommand="SELECT [id], [name] FROM [goalpriority] ORDER BY [name]">
                    </asp:SqlDataSource>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    Due Date:</td>
                <td>
                    <asp:Calendar ID="calDueDate" runat="server"></asp:Calendar>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="btnAdd" runat="server" Text="Add" onclick="btnAdd_Click" 
                        style="height: 26px" />
                    <asp:Button ID="btnCancel" runat="server" Text="Cancel" 
                        onclick="btnCancel_Click" />
                </td>
            </tr>
        </table>
        
    </div>
    </form>
</body>
</html>
